Using Absolute Layout Containers in Responsive Design

Description

For mobile applications it can be useful to have an absolute layout container that has one layout when held vertically, in "portrait" mode, and another design when held horizontally, in "landscape" mode.

Build an AbsoluteLayout Container with Responsive Design

  1. In the UX Builder on the UX Controls page check the 'Mobile' checkbox in the Controls page's toolbar.

    images/res2.png
  2. Open the 'Data Controls' menu. Click on the [TextBox] option to add a textbox control to the component. Give the textbox the name and label of 'firstname'.

    images/res3.png
  3. Add five more [TextBox] controls to the component with the names and labels of 'lastname', 'address', 'city', 'state', and 'zip'.

    images/res4.png
  4. Highlight all of the controls in the controls tree. Open the 'Containers' menu and click on the [Container] option.

    images/res5.png
  5. From the 'Container Type' list select the 'AbsoluteLayout' option and click OK.

    images/res6.png
  6. Highlight the opening absolute layout tag, [AbsoluteLayout: ABSOLUTELAYOUT_1].

    images/res7.png
  7. In the properties list on the right in the 'Container Begin Properties' section click the [...] button next to the 'Absolute positions for controls' property.

    images/res8.png
  8. The Set Absolute Position and Size editor will open. Highlight the firstname control in the list of controls on the left.

    images/res9.png
  9. A dotted rectangular line in the middle pane denotes the area of the layout to be displayed. Place the mouse cursor inside the layout and hold down the left mouse button to add the control to the layout. Drag the mouse, with the left button held down, in order to size the control. Click OK to close the editor.

    images/res10.png
    Once the responsive layout is added this default layout will be hidden.
  10. Highlight everything in the controls tree, the AbsoluteLayout container and all of the textbox controls. Open the 'Panels' menu and click on the [Panel Card] option. Click 'Insert Around' in order to add a panel card around the absolute layout.

    images/res11.png
  11. The controls tree:

    images/res12.png
  12. Open the UX Properties page. Scroll down the properties list to the 'Responsive Layout Settings' section and click the [...] button next to the 'Responsive layout settings' property.

    images/res13.png
  13. In the 'Responsive Layout Genie' click the 'Load rule set' hyperlink.

    images/res14.png
  14. Select the 'System:landscape-portrait' option in the 'Select Rules Set' dialog. Click OK.

    images/res15.png
  15. Highlight the 'landscape' rule that was added to the step 1 section.

    images/res16.png
  16. Click the 'Add Action' button at the bottom of the responsive layout genie.

    images/res17.png
  17. Select the 'Define position/size for controls in an AbsoluteLayout container' action in the 'Select Action' list. Click OK.

    images/res18.png
  18. Highlight 'ABSOLUTELAYOUT_1' in the 'Select AbsoluteLayout Container' prompt. Click OK.

    images/res19.png
  19. Highlight the added action in step 2. In the 'Step 3: Define Action Properties for each Rule' section click the [...] button next to the 'Absolute position for controls' in the 'Absolute Layout Settings'.

    images/res20.png
  20. Design the absolute layout controls as you want them to appear when a device is held in 'landscape' mode. Highlight the controls that you want to add to the layout from the controls list on the left. After highlighting a control, place the mouse cursor inside the dotted layout rectangle in the middle of the editor. Hold down the left mouse button to add the control and then drag, without releasing the mouse button, to adjust the size of the control in the layout.

    images/res21.png
  21. Use the 'Edit Selected' dropdown in the editor's toolbar to align and resize controls. After adding all of the controls click OK.

    images/res22.png
  22. In the Responsive Layout Genie go back to the 'Step 1' section and highlight the 'portrait' rule.

    images/res23.png
  23. In 'Step 2' highlight the 'Define position/size for controls in an AbsoluteLayout container(ABSOLUTELAYOUT_1)' action.

    images/res24.png
  24. In 'Step 3' click on the [...] button next to the 'Absolute position for controls' property.

    images/res25.png
  25. Adjust the layout to the size that it will appear when in portrait mode.

    images/res26.png
  26. Highlight, drag, and drop the controls onto the layout. Design the controls as you want them to appear in portrait mode. Click OK.

    images/res27.png
  27. Run the component in Working Preview. From the dropdown in the Working Preview select a mobile device with a vertical screen displayed. The 'portrait' AbsoluteLayout design should be displayed.

    images/res28.png
  28. From the dropdown select the same mobile device with the screen

    images/res29.png